<?php 

class Ext_Article_Show_Attachment
{
    public $type;
    public $data;
    
    public function __construct($attachmentType, $attachmentDataId)
    {
        $this->_build($attachmentType, $attachmentDataId);
    }

    private function _build($attachmentType, $attachmentDataId)
    {
        $this->type = $attachmentType;
        
        if($attachmentType == 'image'){
            $this->data = new Ext_Attachment_Image_Show($attachmentDataId);
        }elseif($attachmentType == 'video'){
            $this->data = new Ext_Attachment_Video_Show($attachmentDataId);
        }elseif($attachmentType == 'music'){
            $this->data = new Ext_Attachment_Music_Show($attachmentDataId);
        }elseif($attachmentType == 'shopping'){
            $this->data = new Ext_Attachment_Shopping_Show($attachmentDataId);
        }
    }
}